#include <stdio.h>

int main()
{
	/*实验1(a)*/
	float fsum1 = 0.0;
	float fsum2 = 0.0;
	int n = 0;
	do
	{
		n++;
		fsum1 = fsum2;
		fsum2 = fsum2 + 1.0/n;
	} while(fsum1 != fsum2);
	/*实验1(b)*/	
	double dsum1 = 0.0;
	double dsum2 = 0.0;
	int i = 0;	
	do
	{
		i++;		
		dsum1 = dsum2;
		dsum2 = dsum2 + 1.0/i;
	} while (i <= n);
	printf("n：%d\n",n);		
	printf("float_sum：%f\n",fsum2);
	printf("double_sum：%lf\n",dsum2);
	printf("double_sum - float_sum：%lf",dsum2 - fsum2);
	return 0;
}
